﻿

using IotContract.Dtos.Clients;
using IotContract.Interfaces.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotClientService.Services;
/// <summary>
/// web api设备服务
/// </summary>
public class ClientWebService : IClientWebService
{
    public event EventHandler<IotEquipWarnDto> EquipWarnEvent;
    public event EventHandler<string> ErrorEvent;
    public event EventHandler<string> ValueChangeEvent;
    /// <summary>
    /// 触发错误
    /// </summary>
    /// <param name="error"></param>
    public void InvokeErrorEvent(string error)
    {
        ErrorEvent?.Invoke(this, error);
    }
    /// <summary>
    /// 触发值
    /// </summary>
    /// <param name="value"></param>
    public void InvokeValueChangeEvent(string value)
    {
        ValueChangeEvent?.Invoke(this, value);
    }

    /// <summary>
    /// 触发报警
    /// </summary>
    /// <param name="e"></param>
    public void InvokeWarnEvent(IotEquipWarnDto e)
    {
        EquipWarnEvent?.Invoke(this, e);
    }

   
}